home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / include / dplay8.h < prev    next >
C/C++ Source or Header  |  2001-10-16  |  60KB  |  1,190 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1998-2000 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:        DPlay8.h
  6.  *  Content:    DirectPlay8 include file
  7.  *
  8.  ***************************************************************************/
  9.  
  10. #ifndef __DIRECTPLAY8_H__
  11. #define __DIRECTPLAY8_H__
  12.  
  13. #include <ole2.h>            // for DECLARE_INTERFACE and HRESULT
  14.  
  15. #include "dpaddr.h"
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20.  
  21.  
  22. /****************************************************************************
  23.  *
  24.  * DirectPlay8 CLSIDs
  25.  *
  26.  ****************************************************************************/
  27.  
  28. // {743F1DC6-5ABA-429f-8BDF-C54D03253DC2}
  29. DEFINE_GUID(CLSID_DirectPlay8Client,
  30. 0x743f1dc6, 0x5aba, 0x429f, 0x8b, 0xdf, 0xc5, 0x4d, 0x3, 0x25, 0x3d, 0xc2);
  31.  
  32. // {286F484D-375E-4458-A272-B138E2F80A6A}
  33. DEFINE_GUID(CLSID_DirectPlay8Peer,
  34. 0x286f484d, 0x375e, 0x4458, 0xa2, 0x72, 0xb1, 0x38, 0xe2, 0xf8, 0xa, 0x6a);
  35.  
  36. // {DA825E1B-6830-43d7-835D-0B5AD82956A2}
  37. DEFINE_GUID(CLSID_DirectPlay8Server,
  38. 0xda825e1b, 0x6830, 0x43d7, 0x83, 0x5d, 0xb, 0x5a, 0xd8, 0x29, 0x56, 0xa2);
  39.  
  40.  
  41. /****************************************************************************
  42.  *
  43.  * DirectPlay8 Interface IIDs
  44.  *
  45.  ****************************************************************************/
  46.  
  47. // {5102DACD-241B-11d3-AEA7-006097B01411}
  48. DEFINE_GUID(IID_IDirectPlay8Client,
  49. 0x5102dacd, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
  50.  
  51. // {5102DACF-241B-11d3-AEA7-006097B01411}
  52. DEFINE_GUID(IID_IDirectPlay8Peer,
  53. 0x5102dacf, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
  54.  
  55. // {5102DACE-241B-11d3-AEA7-006097B01411}
  56. DEFINE_GUID(IID_IDirectPlay8Server,
  57. 0x5102dace, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
  58.  
  59. /****************************************************************************
  60.  *
  61.  * DirectPlay8 Service Provider GUIDs
  62.  *
  63.  ****************************************************************************/
  64.  
  65. // {53934290-628D-11D2-AE0F-006097B01411}
  66. DEFINE_GUID(CLSID_DP8SP_IPX, 0x53934290, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
  67.  
  68. // {6D4A3650-628D-11D2-AE0F-006097B01411}
  69. DEFINE_GUID(CLSID_DP8SP_MODEM, 0x6d4a3650, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
  70.  
  71. // {743B5D60-628D-11D2-AE0F-006097B01411}
  72. DEFINE_GUID(CLSID_DP8SP_SERIAL, 0x743b5d60, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
  73.  
  74. // {EBFE7BA0-628D-11D2-AE0F-006097B01411}
  75. DEFINE_GUID(CLSID_DP8SP_TCPIP, 0xebfe7ba0, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
  76.  
  77. /****************************************************************************
  78.  *
  79.  * DirectPlay8 Interface Pointer definitions
  80.  *
  81.  ****************************************************************************/
  82.  
  83. typedef    struct IDirectPlay8Peer     *PDIRECTPLAY8PEER;
  84. typedef    struct IDirectPlay8Server    *PDIRECTPLAY8SERVER;
  85. typedef    struct IDirectPlay8Client    *PDIRECTPLAY8CLIENT;
  86.  
  87. /****************************************************************************
  88.  *
  89.  * DirectPlay8 Forward Declarations For External Types
  90.  *
  91.  ****************************************************************************/
  92.  
  93. typedef struct IDirectPlay8LobbiedApplication    *PDNLOBBIEDAPPLICATION;
  94. typedef struct IDirectPlay8Address              IDirectPlay8Address;
  95.  
  96. /****************************************************************************
  97.  *
  98.  * DirectPlay8 Callback Functions
  99.  *
  100.  ****************************************************************************/
  101.  
  102. //
  103. // Callback Function Type Definition
  104. //
  105. typedef HRESULT (WINAPI *PFNDPNMESSAGEHANDLER)(PVOID,DWORD,PVOID);
  106.  
  107. /****************************************************************************
  108.  *
  109.  * DirectPlay8 Datatypes (Non-Structure / Non-Message)
  110.  *
  111.  ****************************************************************************/
  112.  
  113. //
  114. // Player IDs.  Used to uniquely identify a player in a session
  115. //
  116. typedef DWORD    DPNID,      *PDPNID;
  117.  
  118. //
  119. // Used as identifiers for operations
  120. //
  121. typedef    DWORD    DPNHANDLE, *PDPNHANDLE;
  122.  
  123. /****************************************************************************
  124.  *
  125.  * DirectPlay8 Message Identifiers
  126.  *
  127.  ****************************************************************************/
  128.  
  129. #define    DPN_MSGID_OFFSET                    0xFFFF0000
  130. #define DPN_MSGID_ADD_PLAYER_TO_GROUP        ( DPN_MSGID_OFFSET | 0x0001 )
  131. #define DPN_MSGID_APPLICATION_DESC            ( DPN_MSGID_OFFSET | 0x0002 )
  132. #define DPN_MSGID_ASYNC_OP_COMPLETE            ( DPN_MSGID_OFFSET | 0x0003 )
  133. #define DPN_MSGID_CLIENT_INFO                ( DPN_MSGID_OFFSET | 0x0004 )
  134. #define DPN_MSGID_CONNECT_COMPLETE            ( DPN_MSGID_OFFSET | 0x0005 )
  135. #define DPN_MSGID_CREATE_GROUP                ( DPN_MSGID_OFFSET | 0x0006 )
  136. #define DPN_MSGID_CREATE_PLAYER                ( DPN_MSGID_OFFSET | 0x0007 )
  137. #define DPN_MSGID_DESTROY_GROUP                ( DPN_MSGID_OFFSET | 0x0008 )
  138. #define DPN_MSGID_DESTROY_PLAYER            ( DPN_MSGID_OFFSET | 0x0009 )
  139. #define DPN_MSGID_ENUM_HOSTS_QUERY            ( DPN_MSGID_OFFSET | 0x000a )
  140. #define DPN_MSGID_ENUM_HOSTS_RESPONSE        ( DPN_MSGID_OFFSET | 0x000b )
  141. #define DPN_MSGID_GROUP_INFO                ( DPN_MSGID_OFFSET | 0x000c )
  142. #define DPN_MSGID_HOST_MIGRATE                ( DPN_MSGID_OFFSET | 0x000d )
  143. #define DPN_MSGID_INDICATE_CONNECT            ( DPN_MSGID_OFFSET | 0x000e )
  144. #define DPN_MSGID_INDICATED_CONNECT_ABORTED    ( DPN_MSGID_OFFSET | 0x000f )
  145. #define DPN_MSGID_PEER_INFO                    ( DPN_MSGID_OFFSET | 0x0010 )
  146. #define DPN_MSGID_RECEIVE                    ( DPN_MSGID_OFFSET | 0x0011 )
  147. #define DPN_MSGID_REMOVE_PLAYER_FROM_GROUP    ( DPN_MSGID_OFFSET | 0x0012 )
  148. #define    DPN_MSGID_RETURN_BUFFER                ( DPN_MSGID_OFFSET | 0x0013 )
  149. #define DPN_MSGID_SEND_COMPLETE                ( DPN_MSGID_OFFSET | 0x0014 )
  150. #define DPN_MSGID_SERVER_INFO                ( DPN_MSGID_OFFSET | 0x0015 )
  151. #define    DPN_MSGID_TERMINATE_SESSION            ( DPN_MSGID_OFFSET | 0x0016 )
  152.  
  153. /****************************************************************************
  154.  *
  155.  * DirectPlay8 Constants
  156.  *
  157.  ****************************************************************************/
  158.  
  159. #define    DPNID_ALL_PLAYERS_GROUP                0
  160.  
  161. //
  162. // DESTROY_GROUP reasons
  163. //
  164. #define    DPNDESTROYGROUPREASON_NORMAL                0x0001
  165. #define DPNDESTROYGROUPREASON_AUTODESTRUCTED        0x0002
  166. #define    DPNDESTROYGROUPREASON_SESSIONTERMINATED        0x0003
  167.  
  168. //
  169. // DESTROY_PLAYER reasons
  170. //
  171. #define DPNDESTROYPLAYERREASON_NORMAL                0x0001
  172. #define DPNDESTROYPLAYERREASON_CONNECTIONLOST        0x0002
  173. #define    DPNDESTROYPLAYERREASON_SESSIONTERMINATED    0x0003
  174. #define    DPNDESTROYPLAYERREASON_HOSTDESTROYEDPLAYER    0x0004
  175.  
  176. /****************************************************************************
  177.  *
  178.  * DirectPlay8 Flags
  179.  *
  180.  ****************************************************************************/
  181.  
  182. //
  183. // Asynchronous operation flags (For Async Ops)
  184. //
  185. #define DPNOP_SYNC                            0x80000000
  186.  
  187. //
  188. // Add player to group flags (For AddPlayerToGroup)
  189. //
  190. #define DPNADDPLAYERTOGROUP_SYNC            DPNOP_SYNC
  191.  
  192. //
  193. // Cancel flags
  194. //
  195. #define    DPNCANCEL_CONNECT                    0x0001
  196. #define    DPNCANCEL_ENUM                        0x0002
  197. #define    DPNCANCEL_SEND                        0x0004
  198. #define    DPNCANCEL_ALL_OPERATIONS            0x8000
  199.  
  200. //
  201. // Connect flags (For Connect)
  202. //
  203. #define    DPNCONNECT_SYNC                        DPNOP_SYNC
  204. #define    DPNCONNECT_OKTOQUERYFORADDRESSING    0x0001
  205.  
  206. //
  207. // Create group flags (For CreateGroup)
  208. //
  209. #define    DPNCREATEGROUP_SYNC                    DPNOP_SYNC
  210.  
  211. //
  212. // Destroy group flags (For DestroyGroup)
  213. //
  214. #define    DPNDESTROYGROUP_SYNC                DPNOP_SYNC
  215.  
  216. //
  217. // Enumerate clients and groups flags (For EnumPlayersAndGroups)
  218. //
  219. #define DPNENUM_PLAYERS                        0x0001
  220. #define DPNENUM_GROUPS                        0x0010
  221.  
  222. //
  223. // Enum hosts flags (For EnumHosts)
  224. //
  225. #define    DPNENUMHOSTS_SYNC                    DPNOP_SYNC
  226. #define    DPNENUMHOSTS_OKTOQUERYFORADDRESSING    0x0001
  227. #define    DPNENUMHOSTS_NOBROADCASTFALLBACK    0x0002
  228.  
  229. //
  230. // Enum service provider flags (For EnumSP)
  231. //
  232. #define DPNENUMSERVICEPROVIDERS_ALL            0x0001
  233.  
  234. //
  235. // Get send queue info flags (For GetSendQueueInfo)
  236. //
  237. #define    DPNGETSENDQUEUEINFO_PRIORITY_NORMAL    0x0001
  238. #define    DPNGETSENDQUEUEINFO_PRIORITY_HIGH    0x0002
  239. #define    DPNGETSENDQUEUEINFO_PRIORITY_LOW    0x0004
  240.  
  241. //
  242. // Group information flags (For Group Info)
  243. //
  244. #define DPNGROUP_AUTODESTRUCT                0x0001
  245.  
  246. //
  247. // Host flags (For Host)
  248. //
  249. #define    DPNHOST_OKTOQUERYFORADDRESSING        0x0001
  250.  
  251. //
  252. // Set info
  253. //
  254. #define    DPNINFO_NAME                        0x0001
  255. #define    DPNINFO_DATA                        0x0002
  256.  
  257. //
  258. // Initialize flags (For Initialize)
  259. //
  260. #define DPNINITIALIZE_DISABLEPARAMVAL        0x0001
  261.  
  262. //
  263. // Register Lobby flags
  264. //
  265. #define    DPNLOBBY_REGISTER                    0x0001
  266. #define DPNLOBBY_UNREGISTER                    0x0002
  267.  
  268. //
  269. // Player information flags (For Player Info / Player Messages)
  270. //
  271. #define    DPNPLAYER_LOCAL                        0x0002
  272. #define    DPNPLAYER_HOST                        0x0004
  273.  
  274. //
  275. // Remove player from group flags (For RemovePlayerFromGroup)
  276. //
  277. #define    DPNREMOVEPLAYERFROMGROUP_SYNC        DPNOP_SYNC
  278.  
  279. //
  280. // Send flags (For Send/SendTo)
  281. //
  282. #define DPNSEND_SYNC                        DPNOP_SYNC
  283. #define DPNSEND_NOCOPY                        0x0001
  284. #define DPNSEND_NOCOMPLETE                    0x0002
  285. #define DPNSEND_COMPLETEONPROCESS            0x0004
  286. #define DPNSEND_GUARANTEED                    0x0008
  287. #define    DPNSEND_NONSEQUENTIAL                0x0010
  288. #define DPNSEND_NOLOOPBACK                    0x0020
  289. #define    DPNSEND_PRIORITY_LOW                0x0040
  290. #define    DPNSEND_PRIORITY_HIGH                0x0080
  291.  
  292. //
  293. // Session Flags (for DPN_APPLICATION_DESC)
  294. //
  295. #define DPNSESSION_CLIENT_SERVER            0x0001
  296. #define DPNSESSION_MIGRATE_HOST                0x0004
  297. #define DPNSESSION_NODPNSVR                    0x0040
  298. #define DPNSESSION_REQUIREPASSWORD          0x0080
  299.  
  300. //
  301. // Set client info flags (For SetClientInfo)
  302. //
  303. #define DPNSETCLIENTINFO_SYNC                DPNOP_SYNC
  304.  
  305. //
  306. // Set group info flags (For SetGroupInfo)
  307. //
  308. #define DPNSETGROUPINFO_SYNC                DPNOP_SYNC
  309.  
  310. //
  311. // Set peer info flags (For SetPeerInfo)
  312. //
  313. #define DPNSETPEERINFO_SYNC                    DPNOP_SYNC
  314.  
  315. //
  316. // Set server info flags (For SetServerInfo)
  317. //
  318. #define DPNSETSERVERINFO_SYNC                DPNOP_SYNC
  319.  
  320. //
  321. // SP capabilities flags
  322. //
  323. #define    DPNSPCAPS_SUPPORTSDPNSRV            0x0001
  324. #define    DPNSPCAPS_SUPPORTSBROADCAST            0x0002
  325. #define    DPNSPCAPS_SUPPORTSALLADAPTERS        0x0004
  326.  
  327. /****************************************************************************
  328.  *
  329.  * DirectPlay8 Structures (Non-Message)
  330.  *
  331.  ****************************************************************************/
  332.  
  333. //
  334. // Application description
  335. //
  336. typedef struct    _DPN_APPLICATION_DESC
  337. {
  338.     DWORD    dwSize;                            // Size of this structure
  339.     DWORD    dwFlags;                        // Flags (DPNSESSION_...)
  340.     GUID    guidInstance;                    // Instance GUID
  341.     GUID    guidApplication;                // Application GUID
  342.     DWORD    dwMaxPlayers;                    // Maximum # of players allowed (0=no limit)
  343.     DWORD    dwCurrentPlayers;                // Current # of players allowed
  344.     WCHAR    *pwszSessionName;                // Name of the session
  345.     WCHAR    *pwszPassword;                    // Password for the session
  346.     PVOID    pvReservedData;                    
  347.     DWORD    dwReservedDataSize;
  348.     PVOID    pvApplicationReservedData;
  349.     DWORD    dwApplicationReservedDataSize;
  350. } DPN_APPLICATION_DESC, *PDPN_APPLICATION_DESC;
  351.  
  352. //
  353. // Generic Buffer Description
  354. //
  355. typedef struct    _BUFFERDESC
  356. {
  357.     DWORD    dwBufferSize;        
  358.     BYTE *     pBufferData;        
  359. } BUFFERDESC, DPN_BUFFER_DESC, *PDPN_BUFFER_DESC;
  360.  
  361. typedef BUFFERDESC    FAR * PBUFFERDESC;
  362.  
  363. //
  364. // DirectPlay8 capabilities
  365. //
  366. typedef struct    _DPN_CAPS
  367. {
  368.     DWORD   dwSize;                            // Size of this structure
  369.     DWORD    dwFlags;                        // Flags
  370.     DWORD   dwConnectTimeout;                // ms before a connect request times out
  371.     DWORD   dwConnectRetries;                // # of times to attempt the connection
  372.     DWORD   dwTimeoutUntilKeepAlive;        // ms of inactivity before a keep alive is sent
  373. } DPN_CAPS, *PDPN_CAPS;
  374.  
  375. // Connection Statistics information
  376.  
  377. typedef struct _DPN_CONNECTION_INFO
  378. {
  379.     DWORD   dwSize;
  380.     DWORD   dwRoundTripLatencyMS;
  381.     DWORD   dwThroughputBPS;
  382.     DWORD    dwPeakThroughputBPS;
  383.  
  384.     DWORD    dwBytesSentGuaranteed;
  385.     DWORD    dwPacketsSentGuaranteed;
  386.     DWORD    dwBytesSentNonGuaranteed;
  387.     DWORD    dwPacketsSentNonGuaranteed;
  388.  
  389.     DWORD    dwBytesRetried;        // Guaranteed only
  390.     DWORD    dwPacketsRetried;    // Guaranteed only
  391.     DWORD    dwBytesDropped;        // Non Guaranteed only
  392.     DWORD    dwPacketsDropped;    // Non Guaranteed only
  393.  
  394.     DWORD    dwMessagesTransmittedHighPriority;
  395.     DWORD    dwMessagesTimedOutHighPriority;
  396.     DWORD    dwMessagesTransmittedNormalPriority;
  397.     DWORD    dwMessagesTimedOutNormalPriority;
  398.     DWORD    dwMessagesTransmittedLowPriority;
  399.     DWORD    dwMessagesTimedOutLowPriority;
  400.  
  401.     DWORD    dwBytesReceivedGuaranteed;
  402.     DWORD    dwPacketsReceivedGuaranteed;
  403.     DWORD    dwBytesReceivedNonGuaranteed;
  404.     DWORD    dwPacketsReceivedNonGuaranteed;
  405.     DWORD    dwMessagesReceived;
  406.  
  407. } DPN_CONNECTION_INFO, *PDPN_CONNECTION_INFO;
  408.  
  409.  
  410. //
  411. // Group information strucutre
  412. //
  413. typedef struct    _DPN_GROUP_INFO
  414. {
  415.     DWORD    dwSize;                // size of this structure
  416.     DWORD    dwInfoFlags;        // information contained
  417.     PWSTR    pwszName;            // Unicode Name
  418.     PVOID    pvData;                // data block
  419.     DWORD    dwDataSize;            // size in BYTES of data block
  420.     DWORD    dwGroupFlags;        // group flags (DPNGROUP_...)
  421. } DPN_GROUP_INFO, *PDPN_GROUP_INFO;
  422.  
  423. //
  424. // Player information structure
  425. //
  426. typedef struct    _DPN_PLAYER_INFO
  427. {
  428.     DWORD    dwSize;                // size of this structure
  429.     DWORD    dwInfoFlags;        // information contained
  430.     PWSTR    pwszName;            // Unicode Name
  431.     PVOID    pvData;                // data block
  432.     DWORD    dwDataSize;            // size in BYTES of data block
  433.     DWORD    dwPlayerFlags;        // player flags (DPNPLAYER_...)
  434. } DPN_PLAYER_INFO, *PDPN_PLAYER_INFO;
  435.  
  436. typedef struct _DPN_SECURITY_CREDENTIALS    DPN_SECURITY_CREDENTIALS, *PDPN_SECURITY_CREDENTIALS;
  437. typedef struct _DPN_SECURITY_DESC            DPN_SECURITY_DESC, *PDPN_SECURITY_DESC;
  438.  
  439. //
  440. // Service provider & adapter enumeration structure
  441. //
  442. typedef struct _DPN_SERVICE_PROVIDER_INFO
  443. {
  444.     DWORD        dwFlags;
  445.     GUID        guid;        // SP Guid
  446.     WCHAR        *pwszName;    // Friendly Name
  447.     PVOID        pvReserved;    
  448.     DWORD        dwReserved;
  449. } DPN_SERVICE_PROVIDER_INFO, *PDPN_SERVICE_PROVIDER_INFO;
  450.  
  451. //
  452. // Service provider caps structure
  453. //
  454. typedef struct _DPN_SP_CAPS
  455. {
  456.     DWORD   dwSize;                            // Size of this structure
  457.     DWORD   dwFlags;                        // Flags ((DPNSPCAPS_...)
  458.     DWORD   dwNumThreads;                    // # of worker threads to use
  459.     DWORD    dwDefaultEnumCount;                // default # of enum requests
  460.     DWORD    dwDefaultEnumRetryInterval;        // default ms between enum requests
  461.     DWORD    dwDefaultEnumTimeout;            // default enum timeout
  462.     DWORD    dwMaxEnumPayloadSize;            // maximum size in bytes for enum payload data
  463.     DWORD    dwBuffersPerThread;                // number of receive buffers per thread
  464.     DWORD    dwSystemBufferSize;                // amount of buffering to do in addition to posted receive buffers
  465. } DPN_SP_CAPS, *PDPN_SP_CAPS;
  466.  
  467.  
  468. /****************************************************************************
  469.  *
  470.  * IDirectPlay8 message handler call back structures
  471.  *
  472.  ****************************************************************************/
  473.  
  474. //
  475. // Add player to group strucutre for message handler
  476. // (DPN_MSGID_ADD_PLAYER_TO_GROUP)
  477. //
  478. typedef struct    _DPNMSG_ADD_PLAYER_TO_GROUP
  479. {
  480.     DWORD    dwSize;                // Size of this structure
  481.     DPNID    dpnidGroup;            // DPNID of group
  482.     PVOID    pvGroupContext;        // Group context value
  483.     DPNID    dpnidPlayer;        // DPNID of added player
  484.     PVOID    pvPlayerContext;    // Player context value
  485. } DPNMSG_ADD_PLAYER_TO_GROUP, *PDPNMSG_ADD_PLAYER_TO_GROUP;
  486.  
  487. //
  488. // Async operation completion structure for message handler
  489. // (DPN_MSGID_ASYNC_OP_COMPLETE)
  490. //
  491. typedef struct    _DPNMSG_ASYNC_OP_COMPLETE
  492. {
  493.     DWORD        dwSize;            // Size of this structure
  494.     DPNHANDLE    hAsyncOp;        // DirectPlay8 async operation handle
  495.     PVOID        pvUserContext;    // User context supplied
  496.     HRESULT        hResultCode;    // HRESULT of operation
  497. } DPNMSG_ASYNC_OP_COMPLETE, *PDPNMSG_ASYNC_OP_COMPLETE;
  498.  
  499. //
  500. // Client info structure for message handler
  501. // (DPN_MSGID_CLIENT_INFO)
  502. //
  503. typedef struct    _DPNMSG_CLIENT_INFO
  504. {
  505.     DWORD    dwSize;                // Size of this structure
  506.     DPNID    dpnidClient;        // DPNID of client
  507.     PVOID    pvPlayerContext;    // Player context value
  508. } DPNMSG_CLIENT_INFO, *PDPNMSG_CLIENT_INFO;
  509.  
  510. //
  511. // Connect complete structure for message handler
  512. // (DPN_MSGID_CONNECT_COMPLETE)
  513. //
  514. typedef struct    _DPNMSG_CONNECT_COMPLETE
  515. {
  516.     DWORD        dwSize;                        // Size of this structure
  517.     DPNHANDLE    hAsyncOp;                    // DirectPlay8 Async operation handle
  518.     PVOID        pvUserContext;                // User context supplied at Connect
  519.     HRESULT        hResultCode;                // HRESULT of connection attempt
  520.     PVOID        pvApplicationReplyData;        // Connection reply data from Host/Server
  521.     DWORD        dwApplicationReplyDataSize;    // Size (in bytes) of pvApplicationReplyData
  522. } DPNMSG_CONNECT_COMPLETE, *PDPNMSG_CONNECT_COMPLETE;
  523.  
  524. //
  525. // Create group structure for message handler
  526. // (DPN_MSGID_CREATE_GROUP)
  527. //
  528. typedef struct    _DPNMSG_CREATE_GROUP
  529. {
  530.     DWORD    dwSize;                // Size of this structure
  531.     DPNID    dpnidGroup;            // DPNID of new group
  532.     DPNID    dpnidOwner;            // Owner of newgroup
  533.     PVOID    pvGroupContext;        // Group context value
  534. } DPNMSG_CREATE_GROUP, *PDPNMSG_CREATE_GROUP;
  535.  
  536. //
  537. // Create player structure for message handler
  538. // (DPN_MSGID_CREATE_PLAYER)
  539. //
  540. typedef struct    _DPNMSG_CREATE_PLAYER
  541. {
  542.     DWORD    dwSize;                // Size of this structure
  543.     DPNID    dpnidPlayer;        // DPNID of new player
  544.     PVOID    pvPlayerContext;    // Player context value
  545. } DPNMSG_CREATE_PLAYER, *PDPNMSG_CREATE_PLAYER;
  546.  
  547. //
  548. // Destroy group structure for message handler
  549. // (DPN_MSGID_DESTROY_GROUP)
  550. //
  551. typedef struct    _DPNMSG_DESTROY_GROUP
  552. {
  553.     DWORD    dwSize;                // Size of this structure
  554.     DPNID    dpnidGroup;            // DPNID of destroyed group
  555.     PVOID    pvGroupContext;        // Group context value
  556.     DWORD    dwReason;            // Information only
  557. } DPNMSG_DESTROY_GROUP, *PDPNMSG_DESTROY_GROUP;
  558.  
  559. //
  560. // Destroy player structure for message handler
  561. // (DPN_MSGID_DESTROY_PLAYER)
  562. //
  563. typedef struct    _DPNMSG_DESTROY_PLAYER
  564. {
  565.     DWORD    dwSize;                // Size of this structure
  566.     DPNID    dpnidPlayer;        // DPNID of leaving player
  567.     PVOID    pvPlayerContext;    // Player context value
  568.     DWORD    dwReason;            // Information only
  569. } DPNMSG_DESTROY_PLAYER, *PDPNMSG_DESTROY_PLAYER;
  570.  
  571. //
  572. // Enumeration request received structure for message handler
  573. // (DPN_MSGID_ENUM_HOSTS_QUERY)
  574. //
  575. typedef    struct    _DPNMSG_ENUM_HOSTS_QUERY
  576. {
  577.     DWORD                dwSize;                 // Size of this structure.
  578.     IDirectPlay8Address *pAddressSender;        // Address of client who sent the request
  579.     IDirectPlay8Address    *pAddressDevice;        // Address of device request was received on
  580.     PVOID                pvReceivedData;         // Request data (set on client)
  581.     DWORD                dwReceivedDataSize;     // Request data size (set on client)
  582.     DWORD                dwMaxResponseDataSize;    // Max allowable size of enum response
  583.     PVOID                pvResponseData;            // Optional query repsonse (user set)
  584.     DWORD                dwResponseDataSize;        // Optional query response size (user set)
  585.     PVOID                pvResponseContext;        // Optional query response context (user set)
  586. } DPNMSG_ENUM_HOSTS_QUERY, *PDPNMSG_ENUM_HOSTS_QUERY;
  587.  
  588. //
  589. // Enumeration response received structure for message handler
  590. // (DPN_MSGID_ENUM_HOSTS_RESPONSE)
  591. //
  592. typedef    struct    _DPNMSG_ENUM_HOSTS_RESPONSE
  593. {
  594.     DWORD                        dwSize;                     // Size of this structure
  595.     IDirectPlay8Address            *pAddressSender;            // Address of host who responded
  596.     IDirectPlay8Address            *pAddressDevice;            // Device response was received on
  597.     const DPN_APPLICATION_DESC    *pApplicationDescription;   // Application description for the session
  598.     PVOID                        pvResponseData;             // Optional response data (set on host)
  599.     DWORD                        dwResponseDataSize;         // Optional response data size (set on host)
  600.     PVOID                        pvUserContext;              // Context value supplied for enumeration
  601.     DWORD                        dwRoundTripLatencyMS;       // Round trip latency in MS
  602. } DPNMSG_ENUM_HOSTS_RESPONSE, *PDPNMSG_ENUM_HOSTS_RESPONSE;
  603.  
  604. //
  605. // Group info structure for message handler
  606. // (DPN_MSGID_GROUP_INFO)
  607. //
  608. typedef struct    _DPNMSG_GROUP_INFO
  609. {
  610.     DWORD    dwSize;                    // Size of this structure
  611.     DPNID    dpnidGroup;                // DPNID of group
  612.     PVOID    pvGroupContext;            // Group context value
  613. } DPNMSG_GROUP_INFO, *PDPNMSG_GROUP_INFO;
  614.  
  615. //
  616. // Migrate host structure for message handler
  617. // (DPN_MSGID_HOST_MIGRATE)
  618. //
  619. typedef struct    _DPNMSG_HOST_MIGRATE
  620. {
  621.     DWORD    dwSize;                    // Size of this structure
  622.     DPNID    dpnidNewHost;            // DPNID of new Host player
  623.     PVOID    pvPlayerContext;        // Player context value
  624. } DPNMSG_HOST_MIGRATE, *PDPNMSG_HOST_MIGRATE;
  625.  
  626. //
  627. // Indicate connect structure for message handler
  628. // (DPN_MSGID_INDICATE_CONNECT)
  629. //
  630. typedef struct    _DPNMSG_INDICATE_CONNECT
  631. {
  632.     DWORD        dwSize;                    // Size of this structure
  633.     PVOID        pvUserConnectData;        // Connecting player data
  634.     DWORD        dwUserConnectDataSize;    // Size (in bytes) of pvUserConnectData
  635.     PVOID        pvReplyData;            // Connection reply data
  636.     DWORD        dwReplyDataSize;        // Size (in bytes) of pvReplyData
  637.     PVOID        pvReplyContext;            // Buffer context for pvReplyData
  638.     PVOID        pvPlayerContext;        // Player context preset
  639.     IDirectPlay8Address    *pAddressPlayer;// Address of connecting player
  640.     IDirectPlay8Address    *pAddressDevice;// Address of device receiving connect attempt
  641. } DPNMSG_INDICATE_CONNECT, *PDPNMSG_INDICATE_CONNECT;
  642.  
  643. //
  644. // Indicated connect aborted structure for message handler
  645. // (DPN_MSGID_INDICATED_CONNECT_ABORTED)
  646. //
  647. typedef struct    _DPNMSG_INDICATED_CONNECT_ABORTED
  648. {
  649.     DWORD        dwSize;                // Size of this structure
  650.     PVOID        pvPlayerContext;    // Player context preset from DPNMSG_INDICATE_CONNECT
  651. } DPNMSG_INDICATED_CONNECT_ABORTED, *PDPNMSG_INDICATED_CONNECT_ABORTED;
  652.  
  653. //
  654. // Peer info structure for message handler
  655. // (DPN_MSGID_PEER_INFO)
  656. //
  657. typedef struct    _DPNMSG_PEER_INFO
  658. {
  659.     DWORD    dwSize;                    // Size of this structure
  660.     DPNID    dpnidPeer;                // DPNID of peer
  661.     PVOID    pvPlayerContext;        // Player context value
  662. } DPNMSG_PEER_INFO, *PDPNMSG_PEER_INFO;
  663.  
  664. //
  665. // Receive structure for message handler
  666. // (DPN_MSGID_RECEIVE)
  667. //
  668. typedef struct    _DPNMSG_RECEIVE
  669. {
  670.     DWORD        dwSize;                // Size of this structure
  671.     DPNID        dpnidSender;        // DPNID of sending player
  672.     PVOID        pvPlayerContext;    // Player context value of sending player
  673.     PBYTE        pReceiveData;        // Received data
  674.     DWORD        dwReceiveDataSize;    // Size (in bytes) of pReceiveData
  675.     DPNHANDLE    hBufferHandle;        // Buffer handle for pReceiveData
  676. } DPNMSG_RECEIVE, *PDPNMSG_RECEIVE;
  677.  
  678. //
  679. // Remove player from group structure for message handler
  680. // (DPN_MSGID_REMOVE_PLAYER_FROM_GROUP)
  681. //
  682. typedef struct    _DPNMSG_REMOVE_PLAYER_FROM_GROUP
  683. {
  684.     DWORD    dwSize;                    // Size of this structure
  685.     DPNID    dpnidGroup;                // DPNID of group
  686.     PVOID    pvGroupContext;            // Group context value
  687.     DPNID    dpnidPlayer;            // DPNID of deleted player
  688.     PVOID    pvPlayerContext;        // Player context value
  689. } DPNMSG_REMOVE_PLAYER_FROM_GROUP, *PDPNMSG_REMOVE_PLAYER_FROM_GROUP;
  690.  
  691. //
  692. // Returned buffer structure for message handler
  693. // (DPN_MSGID_RETURN_BUFFER)
  694. //
  695. typedef struct    _DPNMSG_RETURN_BUFFER
  696. {
  697.     DWORD        dwSize;                // Size of this structure
  698.     HRESULT        hResultCode;        // Return value of operation
  699.     PVOID        pvBuffer;            // Buffer being returned
  700.     PVOID        pvUserContext;        // Context associated with buffer
  701. } DPNMSG_RETURN_BUFFER, *PDPNMSG_RETURN_BUFFER;
  702.  
  703. //
  704. // Send complete structure for message handler
  705. // (DPN_MSGID_SEND_COMPLETE)
  706. //
  707. typedef struct    _DPNMSG_SEND_COMPLETE
  708. {
  709.     DWORD        dwSize;                // Size of this structure
  710.     DPNHANDLE    hAsyncOp;            // DirectPlay8 Async operation handle
  711.     PVOID        pvUserContext;        // User context supplied at Send/SendTo
  712.     HRESULT        hResultCode;        // HRESULT of send
  713.     DWORD        dwSendTime;            // Send time in ms
  714. } DPNMSG_SEND_COMPLETE, *PDPNMSG_SEND_COMPLETE;
  715.  
  716. //
  717. // Server info structure for message handler
  718. // (DPN_MSGID_SERVER_INFO)
  719. //
  720. typedef struct    _DPNMSG_SERVER_INFO
  721. {
  722.     DWORD    dwSize;                    // Size of this structure
  723.     DPNID    dpnidServer;            // DPNID of server
  724.     PVOID    pvPlayerContext;        // Player context value
  725. } DPNMSG_SERVER_INFO, *PDPNMSG_SERVER_INFO;
  726.  
  727. //
  728. // Terminated session structure for message handler
  729. // (DPN_MSGID_TERMINATE_SESSION)
  730. //
  731. typedef struct    _DPNMSG_TERMINATE_SESSION
  732. {
  733.     DWORD        dwSize;                // Size of this structure
  734.     HRESULT        hResultCode;        // Reason
  735.     PVOID        pvTerminateData;    // Data passed from Host/Server
  736.     DWORD        dwTerminateDataSize;// Size (in bytes) of pvTerminateData
  737. } DPNMSG_TERMINATE_SESSION, *PDPNMSG_TERMINATE_SESSION;
  738.  
  739.  
  740. /****************************************************************************
  741.  *
  742.  * DirectPlay8 Functions
  743.  *
  744.  ****************************************************************************/
  745.  
  746. /*
  747.  * This function is no longer supported.  It is recommended that CoCreateInstance be used to create 
  748.  * DirectPlay8 objects.
  749.  *
  750.  * extern HRESULT WINAPI DirectPlay8Create( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
  751.  * 
  752.  */
  753.  
  754. /****************************************************************************
  755.  *
  756.  * DirectPlay8 Application Interfaces
  757.  *
  758.  ****************************************************************************/
  759.  
  760. //
  761. // COM definition for DirectPlay8 Client interface
  762. //
  763. #undef INTERFACE                // External COM Implementation
  764. #define INTERFACE IDirectPlay8Client
  765. DECLARE_INTERFACE_(IDirectPlay8Client,IUnknown)
  766. {
  767.     /*** IUnknown methods ***/
  768.     STDMETHOD(QueryInterface)            (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  769.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  770.     STDMETHOD_(ULONG,Release)            (THIS) PURE;
  771.     /*** IDirectPlay8Client methods ***/
  772.     STDMETHOD(Initialize)                (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE;
  773.     STDMETHOD(EnumServiceProviders)        (THIS_ const GUID *const pguidServiceProvider, const GUID *const pguidApplication, DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, PDWORD const pcbEnumData, PDWORD const pcReturned, const DWORD dwFlags) PURE;
  774.     STDMETHOD(EnumHosts)                (THIS_ PDPN_APPLICATION_DESC const pApplicationDesc,IDirectPlay8Address *const pAddrHost,IDirectPlay8Address *const pDeviceInfo,PVOID const pUserEnumData,const DWORD dwUserEnumDataSize,const DWORD dwEnumCount,const DWORD dwRetryInterval,const DWORD dwTimeOut,PVOID const pvUserContext,DPNHANDLE *const pAsyncHandle,const DWORD dwFlags) PURE;
  775.     STDMETHOD(CancelAsyncOperation)        (THIS_ const DPNHANDLE hAsyncHandle, const DWORD dwFlags) PURE;
  776.     STDMETHOD(Connect)                    (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address *const pHostAddr,IDirectPlay8Address *const pDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,const void *const pvUserConnectData,const DWORD dwUserConnectDataSize,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
  777.     STDMETHOD(Send)                        (THIS_ const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
  778.     STDMETHOD(GetSendQueueInfo)            (THIS_ DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE;
  779.     STDMETHOD(GetApplicationDesc)        (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE;
  780.     STDMETHOD(SetClientInfo)            (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  781.     STDMETHOD(GetServerInfo)            (THIS_ DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE;
  782.     STDMETHOD(GetServerAddress)            (THIS_ IDirectPlay8Address **const pAddress,const DWORD dwFlags) PURE;
  783.     STDMETHOD(Close)                    (THIS_ const DWORD dwFlags) PURE;
  784.     STDMETHOD(ReturnBuffer)                (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE;
  785.     STDMETHOD(GetCaps)                    (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE;
  786.     STDMETHOD(SetCaps)                    (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE;
  787.     STDMETHOD(SetSPCaps)                (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE;
  788.     STDMETHOD(GetSPCaps)                (THIS_ const GUID * const pguidSP,DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE;
  789.     STDMETHOD(GetConnectionInfo)        (THIS_ DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE;
  790.     STDMETHOD(RegisterLobby)            (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE;
  791. };
  792.  
  793. //
  794. // COM definition for DirectPlay8 Server interface
  795. //
  796. #undef INTERFACE                // External COM Implementation
  797. #define INTERFACE IDirectPlay8Server
  798. DECLARE_INTERFACE_(IDirectPlay8Server,IUnknown)
  799. {
  800.     /*** IUnknown methods ***/
  801.     STDMETHOD(QueryInterface)            (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  802.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  803.     STDMETHOD_(ULONG,Release)            (THIS) PURE;
  804.     /*** IDirectPlay8Server methods ***/
  805.     STDMETHOD(Initialize)                (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE;
  806.     STDMETHOD(EnumServiceProviders)        (THIS_ const GUID *const pguidServiceProvider,const GUID *const pguidApplication,DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer,PDWORD const pcbEnumData,PDWORD const pcReturned,const DWORD dwFlags) PURE;
  807.     STDMETHOD(CancelAsyncOperation)        (THIS_ const DPNHANDLE hAsyncHandle,const DWORD dwFlags) PURE;
  808.     STDMETHOD(GetSendQueueInfo)            (THIS_ const DPNID dpnid,DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE;
  809.     STDMETHOD(GetApplicationDesc)        (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE;
  810.     STDMETHOD(SetServerInfo)            (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  811.     STDMETHOD(GetClientInfo)            (THIS_ const DPNID dpnid,DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE;
  812.     STDMETHOD(GetClientAddress)            (THIS_ const DPNID dpnid,IDirectPlay8Address **const pAddress,const DWORD dwFlags) PURE;
  813.     STDMETHOD(GetLocalHostAddresses)    (THIS_ IDirectPlay8Address **const prgpAddress,DWORD *const pcAddress,const DWORD dwFlags) PURE;
  814.     STDMETHOD(SetApplicationDesc)        (THIS_ const DPN_APPLICATION_DESC *const pad, const DWORD dwFlags) PURE;
  815.     STDMETHOD(Host)                        (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address **const prgpDeviceInfo,const DWORD cDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,void *const pvPlayerContext,const DWORD dwFlags) PURE;
  816.     STDMETHOD(SendTo)                    (THIS_ const DPNID dpnid,const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
  817.     STDMETHOD(CreateGroup)                (THIS_ const DPN_GROUP_INFO *const pdpnGroupInfo,void *const pvGroupContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
  818.     STDMETHOD(DestroyGroup)                (THIS_ const DPNID idGroup, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  819.     STDMETHOD(AddPlayerToGroup)            (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  820.     STDMETHOD(RemovePlayerFromGroup)    (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  821.     STDMETHOD(SetGroupInfo)                (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  822.     STDMETHOD(GetGroupInfo)                (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE;
  823.     STDMETHOD(EnumPlayersAndGroups)        (THIS_ DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE;
  824.     STDMETHOD(EnumGroupMembers)            (THIS_ const DPNID dpnid, DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE;
  825.     STDMETHOD(Close)                    (THIS_ const DWORD dwFlags) PURE;
  826.     STDMETHOD(DestroyClient)            (THIS_ const DPNID dpnidClient, const void *const pvDestroyData, const DWORD dwDestroyDataSize, const DWORD dwFlags) PURE;
  827.     STDMETHOD(ReturnBuffer)                (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE;
  828.     STDMETHOD(GetPlayerContext)            (THIS_ const DPNID dpnid,PVOID *const ppvPlayerContext,const DWORD dwFlags) PURE;
  829.     STDMETHOD(GetGroupContext)            (THIS_ const DPNID dpnid,PVOID *const ppvGroupContext,const DWORD dwFlags) PURE;
  830.     STDMETHOD(GetCaps)                    (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE;
  831.     STDMETHOD(SetCaps)                    (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE;
  832.     STDMETHOD(SetSPCaps)                (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE;
  833.     STDMETHOD(GetSPCaps)                (THIS_ const GUID * const pguidSP, DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE;
  834.     STDMETHOD(GetConnectionInfo)        (THIS_ const DPNID dpnid, DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE;
  835.     STDMETHOD(RegisterLobby)            (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE;
  836. };
  837.  
  838. //
  839. // COM definition for DirectPlay8 Peer interface
  840. //
  841. #undef INTERFACE                // External COM Implementation
  842. #define INTERFACE IDirectPlay8Peer
  843. DECLARE_INTERFACE_(IDirectPlay8Peer,IUnknown)
  844. {
  845.     /*** IUnknown methods ***/
  846.     STDMETHOD(QueryInterface)            (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  847.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  848.     STDMETHOD_(ULONG,Release)            (THIS) PURE;
  849.     /*** IDirectPlay8Peer methods ***/
  850.     STDMETHOD(Initialize)                (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE;
  851.     STDMETHOD(EnumServiceProviders)        (THIS_ const GUID *const pguidServiceProvider, const GUID *const pguidApplication, DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, DWORD *const pcbEnumData, DWORD *const pcReturned, const DWORD dwFlags) PURE;
  852.     STDMETHOD(CancelAsyncOperation)        (THIS_ const DPNHANDLE hAsyncHandle, const DWORD dwFlags) PURE;
  853.     STDMETHOD(Connect)                    (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address *const pHostAddr,IDirectPlay8Address *const pDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,const void *const pvUserConnectData,const DWORD dwUserConnectDataSize,void *const pvPlayerContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
  854.     STDMETHOD(SendTo)                    (THIS_ const DPNID dpnid,const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
  855.     STDMETHOD(GetSendQueueInfo)            (THIS_ const DPNID dpnid, DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE;
  856.     STDMETHOD(Host)                        (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address **const prgpDeviceInfo,const DWORD cDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,void *const pvPlayerContext,const DWORD dwFlags) PURE;
  857.     STDMETHOD(GetApplicationDesc)        (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE;
  858.     STDMETHOD(SetApplicationDesc)        (THIS_ const DPN_APPLICATION_DESC *const pad, const DWORD dwFlags) PURE;
  859.     STDMETHOD(CreateGroup)                (THIS_ const DPN_GROUP_INFO *const pdpnGroupInfo,void *const pvGroupContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
  860.     STDMETHOD(DestroyGroup)                (THIS_ const DPNID idGroup, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  861.     STDMETHOD(AddPlayerToGroup)            (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  862.     STDMETHOD(RemovePlayerFromGroup)    (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  863.     STDMETHOD(SetGroupInfo)                (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  864.     STDMETHOD(GetGroupInfo)                (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE;
  865.     STDMETHOD(EnumPlayersAndGroups)        (THIS_ DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE;
  866.     STDMETHOD(EnumGroupMembers)            (THIS_ const DPNID dpnid, DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE;
  867.     STDMETHOD(SetPeerInfo)                (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
  868.     STDMETHOD(GetPeerInfo)                (THIS_ const DPNID dpnid,DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE;
  869.     STDMETHOD(GetPeerAddress)            (THIS_ const DPNID dpnid,IDirectPlay8Address **const pAddress,const DWORD dwFlags) PURE;
  870.     STDMETHOD(GetLocalHostAddresses)    (THIS_ IDirectPlay8Address **const prgpAddress,DWORD *const pcAddress,const DWORD dwFlags) PURE;
  871.     STDMETHOD(Close)                    (THIS_ const DWORD dwFlags) PURE;
  872.     STDMETHOD(EnumHosts)                (THIS_ PDPN_APPLICATION_DESC const pApplicationDesc,IDirectPlay8Address *const pAddrHost,IDirectPlay8Address *const pDeviceInfo,PVOID const pUserEnumData,const DWORD dwUserEnumDataSize,const DWORD dwEnumCount,const DWORD dwRetryInterval,const DWORD dwTimeOut,PVOID const pvUserContext,DPNHANDLE *const pAsyncHandle,const DWORD dwFlags) PURE;
  873.     STDMETHOD(DestroyPeer)                (THIS_ const DPNID dpnidClient, const void *const pvDestroyData, const DWORD dwDestroyDataSize, const DWORD dwFlags) PURE;
  874.     STDMETHOD(ReturnBuffer)                (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE;
  875.     STDMETHOD(GetPlayerContext)            (THIS_ const DPNID dpnid,PVOID *const ppvPlayerContext,const DWORD dwFlags) PURE;
  876.     STDMETHOD(GetGroupContext)            (THIS_ const DPNID dpnid,PVOID *const ppvGroupContext,const DWORD dwFlags) PURE;
  877.     STDMETHOD(GetCaps)                    (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE;
  878.     STDMETHOD(SetCaps)                    (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE;
  879.     STDMETHOD(SetSPCaps)                (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE;
  880.     STDMETHOD(GetSPCaps)                (THIS_ const GUID * const pguidSP, DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE;
  881.     STDMETHOD(GetConnectionInfo)        (THIS_ const DPNID dpnid, DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE;
  882.     STDMETHOD(RegisterLobby)            (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE;
  883.     STDMETHOD(TerminateSession)            (THIS_ void *const pvTerminateData,const DWORD dwTerminateDataSize,const DWORD dwFlags) PURE;
  884. };
  885.  
  886.  
  887. /****************************************************************************
  888.  *
  889.  * IDirectPlay8 application interface macros
  890.  *
  891.  ****************************************************************************/
  892.  
  893. #if !defined(__cplusplus) || defined(CINTERFACE)
  894.  
  895. #define    IDirectPlay8Client_QueryInterface(p,a,b)                (p)->lpVtbl->QueryInterface(p,a,b)
  896. #define    IDirectPlay8Client_AddRef(p)                            (p)->lpVtbl->AddRef(p)
  897. #define    IDirectPlay8Client_Release(p)                            (p)->lpVtbl->Release(p)
  898. #define    IDirectPlay8Client_Initialize(p,a,b,c)                    (p)->lpVtbl->Initialize(p,a,b,c)
  899. #define    IDirectPlay8Client_EnumServiceProviders(p,a,b,c,d,e,f)    (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f)
  900. #define    IDirectPlay8Client_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)    (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)
  901. #define    IDirectPlay8Client_CancelAsyncOperation(p,a,b)            (p)->lpVtbl->CancelAsyncOperation(p,a,b)
  902. #define    IDirectPlay8Client_Connect(p,a,b,c,d,e,f,g,h,i,j)        (p)->lpVtbl->Connect(p,a,b,c,d,e,f,g,h,i,j)
  903. #define    IDirectPlay8Client_Send(p,a,b,c,d,e,f)                    (p)->lpVtbl->Send(p,a,b,c,d,e,f)
  904. #define    IDirectPlay8Client_GetSendQueueInfo(p,a,b,c)            (p)->lpVtbl->GetSendQueueInfo(p,a,b,c)
  905. #define    IDirectPlay8Client_GetApplicationDesc(p,a,b,c)            (p)->lpVtbl->GetApplicationDesc(p,a,b,c)
  906. #define    IDirectPlay8Client_SetClientInfo(p,a,b,c,d)                (p)->lpVtbl->SetClientInfo(p,a,b,c,d)
  907. #define    IDirectPlay8Client_GetServerInfo(p,a,b,c)                (p)->lpVtbl->GetServerInfo(p,a,b,c)
  908. #define    IDirectPlay8Client_GetServerAddress(p,a,b)                (p)->lpVtbl->GetServerAddress(p,a,b)
  909. #define    IDirectPlay8Client_Close(p,a)                            (p)->lpVtbl->Close(p,a)
  910. #define    IDirectPlay8Client_ReturnBuffer(p,a,b)                    (p)->lpVtbl->ReturnBuffer(p,a,b)
  911. #define    IDirectPlay8Client_GetCaps(p,a,b)                        (p)->lpVtbl->GetCaps(p,a,b)
  912. #define    IDirectPlay8Client_SetCaps(p,a,b)                        (p)->lpVtbl->SetCaps(p,a,b)
  913. #define    IDirectPlay8Client_SetSPCaps(p,a,b,c)                    (p)->lpVtbl->SetSPCaps(p,a,b,c)
  914. #define    IDirectPlay8Client_GetSPCaps(p,a,b,c)                    (p)->lpVtbl->GetSPCaps(p,a,b,c)
  915. #define    IDirectPlay8Client_GetConnectionInfo(p,a,b)                (p)->lpVtbl->GetConnectionInfo(p,a,b)
  916. #define    IDirectPlay8Client_RegisterLobby(p,a,b,c)                (p)->lpVtbl->RegisterLobby(p,a,b,c)
  917.  
  918. #define    IDirectPlay8Server_QueryInterface(p,a,b)                (p)->lpVtbl->QueryInterface(p,a,b)
  919. #define    IDirectPlay8Server_AddRef(p)                            (p)->lpVtbl->AddRef(p)
  920. #define    IDirectPlay8Server_Release(p)                            (p)->lpVtbl->Release(p)
  921. #define    IDirectPlay8Server_Initialize(p,a,b,c)                    (p)->lpVtbl->Initialize(p,a,b,c)
  922. #define    IDirectPlay8Server_EnumServiceProviders(p,a,b,c,d,e,f)    (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f)
  923. #define    IDirectPlay8Server_CancelAsyncOperation(p,a,b)            (p)->lpVtbl->CancelAsyncOperation(p,a,b)
  924. #define    IDirectPlay8Server_GetSendQueueInfo(p,a,b,c,d)            (p)->lpVtbl->GetSendQueueInfo(p,a,b,c,d)
  925. #define    IDirectPlay8Server_GetApplicationDesc(p,a,b,c)            (p)->lpVtbl->GetApplicationDesc(p,a,b,c)
  926. #define    IDirectPlay8Server_SetServerInfo(p,a,b,c,d)                (p)->lpVtbl->SetServerInfo(p,a,b,c,d)
  927. #define    IDirectPlay8Server_GetClientInfo(p,a,b,c,d)                (p)->lpVtbl->GetClientInfo(p,a,b,c,d)
  928. #define    IDirectPlay8Server_GetClientAddress(p,a,b,c)            (p)->lpVtbl->GetClientAddress(p,a,b,c)
  929. #define    IDirectPlay8Server_GetLocalHostAddresses(p,a,b,c)        (p)->lpVtbl->GetLocalHostAddresses(p,a,b,c)
  930. #define    IDirectPlay8Server_SetApplicationDesc(p,a,b)            (p)->lpVtbl->SetApplicationDesc(p,a,b)
  931. #define    IDirectPlay8Server_Host(p,a,b,c,d,e,f,g)                (p)->lpVtbl->Host(p,a,b,c,d,e,f,g)
  932. #define    IDirectPlay8Server_SendTo(p,a,b,c,d,e,f,g)                (p)->lpVtbl->SendTo(p,a,b,c,d,e,f,g)
  933. #define    IDirectPlay8Server_CreateGroup(p,a,b,c,d,e)                (p)->lpVtbl->CreateGroup(p,a,b,c,d,e)
  934. #define    IDirectPlay8Server_DestroyGroup(p,a,b,c,d)                (p)->lpVtbl->DestroyGroup(p,a,b,c,d)
  935. #define    IDirectPlay8Server_AddPlayerToGroup(p,a,b,c,d,e)        (p)->lpVtbl->AddPlayerToGroup(p,a,b,c,d,e)
  936. #define    IDirectPlay8Server_RemovePlayerFromGroup(p,a,b,c,d,e)    (p)->lpVtbl->RemovePlayerFromGroup(p,a,b,c,d,e)
  937. #define    IDirectPlay8Server_SetGroupInfo(p,a,b,c,d,e)            (p)->lpVtbl->SetGroupInfo(p,a,b,c,d,e)
  938. #define    IDirectPlay8Server_GetGroupInfo(p,a,b,c,d)                (p)->lpVtbl->GetGroupInfo(p,a,b,c,d)
  939. #define    IDirectPlay8Server_EnumPlayersAndGroups(p,a,b,c)        (p)->lpVtbl->EnumPlayersAndGroups(p,a,b,c)
  940. #define    IDirectPlay8Server_EnumGroupMembers(p,a,b,c,d)            (p)->lpVtbl->EnumGroupMembers(p,a,b,c,d)
  941. #define    IDirectPlay8Server_Close(p,a)                            (p)->lpVtbl->Close(p,a)
  942. #define    IDirectPlay8Server_DestroyClient(p,a,b,c,d)                (p)->lpVtbl->DestroyClient(p,a,b,c,d)
  943. #define    IDirectPlay8Server_ReturnBuffer(p,a,b)                    (p)->lpVtbl->ReturnBuffer(p,a,b)
  944. #define    IDirectPlay8Server_GetPlayerContext(p,a,b,c)            (p)->lpVtbl->GetPlayerContext(p,a,b,c)
  945. #define    IDirectPlay8Server_GetGroupContext(p,a,b,c)                (p)->lpVtbl->GetGroupContext(p,a,b,c)
  946. #define    IDirectPlay8Server_GetCaps(p,a,b)                        (p)->lpVtbl->GetCaps(p,a,b)
  947. #define    IDirectPlay8Server_SetCaps(p,a,b)                        (p)->lpVtbl->SetCaps(p,a,b)
  948. #define    IDirectPlay8Server_SetSPCaps(p,a,b,c)                    (p)->lpVtbl->SetSPCaps(p,a,b,c)
  949. #define    IDirectPlay8Server_GetSPCaps(p,a,b,c)                    (p)->lpVtbl->GetSPCaps(p,a,b,c)
  950. #define    IDirectPlay8Server_GetConnectionInfo(p,a,b,c)            (p)->lpVtbl->GetConnectionInfo(p,a,b,c)
  951. #define    IDirectPlay8Server_RegisterLobby(p,a,b,c)                (p)->lpVtbl->RegisterLobby(p,a,b,c)
  952.  
  953. #define    IDirectPlay8Peer_QueryInterface(p,a,b)                    (p)->lpVtbl->QueryInterface(p,a,b)
  954. #define    IDirectPlay8Peer_AddRef(p)                                (p)->lpVtbl->AddRef(p)
  955. #define    IDirectPlay8Peer_Release(p)                                (p)->lpVtbl->Release(p)
  956. #define    IDirectPlay8Peer_Initialize(p,a,b,c)                    (p)->lpVtbl->Initialize(p,a,b,c)
  957. #define    IDirectPlay8Peer_EnumServiceProviders(p,a,b,c,d,e,f)    (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f)
  958. #define    IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)        (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)
  959.  
  960. #define    IDirectPlay8Peer_CancelAsyncOperation(p,a,b)            (p)->lpVtbl->CancelAsyncOperation(p,a,b)
  961. #define    IDirectPlay8Peer_Connect(p,a,b,c,d,e,f,g,h,i,j,k)        (p)->lpVtbl->Connect(p,a,b,c,d,e,f,g,h,i,j,k)
  962. #define    IDirectPlay8Peer_SendTo(p,a,b,c,d,e,f,g)                (p)->lpVtbl->SendTo(p,a,b,c,d,e,f,g)
  963. #define    IDirectPlay8Peer_GetSendQueueInfo(p,a,b,c,d)            (p)->lpVtbl->GetSendQueueInfo(p,a,b,c,d)
  964. #define    IDirectPlay8Peer_Host(p,a,b,c,d,e,f,g)                    (p)->lpVtbl->Host(p,a,b,c,d,e,f,g)
  965. #define    IDirectPlay8Peer_GetApplicationDesc(p,a,b,c)            (p)->lpVtbl->GetApplicationDesc(p,a,b,c)
  966. #define    IDirectPlay8Peer_SetApplicationDesc(p,a,b)                (p)->lpVtbl->SetApplicationDesc(p,a,b)
  967. #define    IDirectPlay8Peer_CreateGroup(p,a,b,c,d,e)                (p)->lpVtbl->CreateGroup(p,a,b,c,d,e)
  968. #define    IDirectPlay8Peer_DestroyGroup(p,a,b,c,d)                (p)->lpVtbl->DestroyGroup(p,a,b,c,d)
  969. #define    IDirectPlay8Peer_AddPlayerToGroup(p,a,b,c,d,e)            (p)->lpVtbl->AddPlayerToGroup(p,a,b,c,d,e)
  970. #define    IDirectPlay8Peer_RemovePlayerFromGroup(p,a,b,c,d,e)        (p)->lpVtbl->RemovePlayerFromGroup(p,a,b,c,d,e)
  971. #define    IDirectPlay8Peer_SetGroupInfo(p,a,b,c,d,e)                (p)->lpVtbl->SetGroupInfo(p,a,b,c,d,e)
  972. #define    IDirectPlay8Peer_GetGroupInfo(p,a,b,c,d)                (p)->lpVtbl->GetGroupInfo(p,a,b,c,d)
  973. #define    IDirectPlay8Peer_EnumPlayersAndGroups(p,a,b,c)            (p)->lpVtbl->EnumPlayersAndGroups(p,a,b,c)
  974. #define    IDirectPlay8Peer_EnumGroupMembers(p,a,b,c,d)            (p)->lpVtbl->EnumGroupMembers(p,a,b,c,d)
  975. #define    IDirectPlay8Peer_SetPeerInfo(p,a,b,c,d)                    (p)->lpVtbl->SetPeerInfo(p,a,b,c,d)
  976. #define    IDirectPlay8Peer_GetPeerInfo(p,a,b,c,d)                    (p)->lpVtbl->GetPeerInfo(p,a,b,c,d)
  977. #define    IDirectPlay8Peer_GetPeerAddress(p,a,b,c)                (p)->lpVtbl->GetPeerAddress(p,a,b,c)
  978. #define    IDirectPlay8Peer_GetLocalHostAddresses(p,a,b,c)            (p)->lpVtbl->GetLocalHostAddresses(p,a,b,c)
  979. #define    IDirectPlay8Peer_Close(p,a)                                (p)->lpVtbl->Close(p,a)
  980. #define    IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)        (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)
  981. #define    IDirectPlay8Peer_DestroyPeer(p,a,b,c,d)                    (p)->lpVtbl->DestroyPeer(p,a,b,c,d)
  982. #define    IDirectPlay8Peer_ReturnBuffer(p,a,b)                    (p)->lpVtbl->ReturnBuffer(p,a,b)
  983. #define    IDirectPlay8Peer_GetPlayerContext(p,a,b,c)                (p)->lpVtbl->GetPlayerContext(p,a,b,c)
  984. #define    IDirectPlay8Peer_GetGroupContext(p,a,b,c)                (p)->lpVtbl->GetGroupContext(p,a,b,c)
  985. #define    IDirectPlay8Peer_GetCaps(p,a,b)                            (p)->lpVtbl->GetCaps(p,a,b)
  986. #define    IDirectPlay8Peer_SetCaps(p,a,b)                            (p)->lpVtbl->SetCaps(p,a,b)
  987. #define    IDirectPlay8Peer_SetSPCaps(p,a,b,c)                        (p)->lpVtbl->SetSPCaps(p,a,b,c)
  988. #define    IDirectPlay8Peer_GetSPCaps(p,a,b,c)                        (p)->lpVtbl->GetSPCaps(p,a,b,c)
  989. #define    IDirectPlay8Peer_GetConnectionInfo(p,a,b,c)                (p)->lpVtbl->GetConnectionInfo(p,a,b,c)
  990. #define    IDirectPlay8Peer_RegisterLobby(p,a,b,c)                    (p)->lpVtbl->RegisterLobby(p,a,b,c)
  991. #define    IDirectPlay8Peer_TerminateSession(p,a,b,c)                (p)->lpVtbl->TerminateSession(p,a,b,c)
  992.  
  993. #else /* C++ */
  994.  
  995. #define    IDirectPlay8Client_QueryInterface(p,a,b)                (p)->QueryInterface(a,b)
  996. #define    IDirectPlay8Client_AddRef(p)                            (p)->AddRef()
  997. #define    IDirectPlay8Client_Release(p)                            (p)->Release()
  998. #define    IDirectPlay8Client_Initialize(p,a,b,c)                    (p)->Initialize(a,b,c)
  999. #define    IDirectPlay8Client_EnumServiceProviders(p,a,b,c,d,e,f)    (p)->EnumServiceProviders(a,b,c,d,e,f)
  1000. #define    IDirectPlay8Client_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)    (p)->EnumHosts(a,b,c,d,e,f,g,h,i,j,k)
  1001. #define    IDirectPlay8Client_CancelAsyncOperation(p,a,b)            (p)->CancelAsyncOperation(a,b)
  1002. #define    IDirectPlay8Client_Connect(p,a,b,c,d,e,f,g,h,i,j)        (p)->Connect(a,b,c,d,e,f,g,h,i,j)
  1003. #define    IDirectPlay8Client_Send(p,a,b,c,d,e,f)                    (p)->Send(a,b,c,d,e,f)
  1004. #define    IDirectPlay8Client_GetSendQueueInfo(p,a,b,c)            (p)->GetSendQueueInfo(a,b,c)
  1005. #define    IDirectPlay8Client_GetApplicationDesc(p,a,b,c)            (p)->GetApplicationDesc(a,b,c)
  1006. #define    IDirectPlay8Client_SetClientInfo(p,a,b,c,d)                (p)->SetClientInfo(a,b,c,d)
  1007. #define    IDirectPlay8Client_GetServerInfo(p,a,b,c)                (p)->GetServerInfo(a,b,c)
  1008. #define    IDirectPlay8Client_GetServerAddress(p,a,b)                (p)->GetServerAddress(a,b)
  1009. #define    IDirectPlay8Client_Close(p,a)                            (p)->Close(a)
  1010. #define    IDirectPlay8Client_ReturnBuffer(p,a,b)                    (p)->ReturnBuffer(a,b)
  1011. #define    IDirectPlay8Client_GetCaps(p,a,b)                        (p)->GetCaps(a,b)
  1012. #define    IDirectPlay8Client_SetCaps(p,a,b)                        (p)->SetCaps(a,b)
  1013. #define    IDirectPlay8Client_SetSPCaps(p,a,b,c)                    (p)->SetSPCaps(a,b,c)
  1014. #define    IDirectPlay8Client_GetSPCaps(p,a,b,c)                    (p)->GetSPCaps(a,b,c)
  1015. #define    IDirectPlay8Client_GetConnectionInfo(p,a,b)                (p)->GetConnectionInfo(a,b)
  1016. #define    IDirectPlay8Client_RegisterLobby(p,a,b,c)                (p)->RegisterLobby(a,b,c)
  1017.  
  1018. #define    IDirectPlay8Server_QueryInterface(p,a,b)                (p)->QueryInterface(a,b)
  1019. #define    IDirectPlay8Server_AddRef(p)                            (p)->AddRef()
  1020. #define    IDirectPlay8Server_Release(p)                            (p)->Release()
  1021. #define    IDirectPlay8Server_Initialize(p,a,b,c)                    (p)->Initialize(a,b,c)
  1022. #define    IDirectPlay8Server_EnumServiceProviders(p,a,b,c,d,e,f)    (p)->EnumServiceProviders(a,b,c,d,e,f)
  1023. #define    IDirectPlay8Server_CancelAsyncOperation(p,a,b)            (p)->CancelAsyncOperation(a,b)
  1024. #define    IDirectPlay8Server_GetSendQueueInfo(p,a,b,c,d)            (p)->GetSendQueueInfo(a,b,c,d)
  1025. #define    IDirectPlay8Server_GetApplicationDesc(p,a,b,c)            (p)->GetApplicationDesc(a,b,c)
  1026. #define    IDirectPlay8Server_SetServerInfo(p,a,b,c,d)                (p)->SetServerInfo(a,b,c,d)
  1027. #define    IDirectPlay8Server_GetClientInfo(p,a,b,c,d)                (p)->GetClientInfo(a,b,c,d)
  1028. #define    IDirectPlay8Server_GetClientAddress(p,a,b,c)            (p)->GetClientAddress(a,b,c)
  1029. #define    IDirectPlay8Server_GetLocalHostAddresses(p,a,b,c)        (p)->GetLocalHostAddresses(a,b,c)
  1030. #define    IDirectPlay8Server_SetApplicationDesc(p,a,b)            (p)->SetApplicationDesc(a,b)
  1031. #define    IDirectPlay8Server_Host(p,a,b,c,d,e,f,g)                (p)->Host(a,b,c,d,e,f,g)
  1032. #define    IDirectPlay8Server_SendTo(p,a,b,c,d,e,f,g)                (p)->SendTo(a,b,c,d,e,f,g)
  1033. #define    IDirectPlay8Server_CreateGroup(p,a,b,c,d,e)                (p)->CreateGroup(a,b,c,d,e)
  1034. #define    IDirectPlay8Server_DestroyGroup(p,a,b,c,d)                (p)->DestroyGroup(a,b,c,d)
  1035. #define    IDirectPlay8Server_AddPlayerToGroup(p,a,b,c,d,e)        (p)->AddPlayerToGroup(a,b,c,d,e)
  1036. #define    IDirectPlay8Server_RemovePlayerFromGroup(p,a,b,c,d,e)    (p)->RemovePlayerFromGroup(a,b,c,d,e)
  1037. #define    IDirectPlay8Server_SetGroupInfo(p,a,b,c,d,e)            (p)->SetGroupInfo(a,b,c,d,e)
  1038. #define    IDirectPlay8Server_GetGroupInfo(p,a,b,c,d)                (p)->GetGroupInfo(a,b,c,d)
  1039. #define    IDirectPlay8Server_EnumPlayersAndGroups(p,a,b,c)        (p)->EnumPlayersAndGroups(a,b,c)
  1040. #define    IDirectPlay8Server_EnumGroupMembers(p,a,b,c,d)            (p)->EnumGroupMembers(a,b,c,d)
  1041. #define    IDirectPlay8Server_Close(p,a)                            (p)->Close(a)
  1042. #define    IDirectPlay8Server_DestroyClient(p,a,b,c,d)                (p)->DestroyClient(a,b,c,d)
  1043. #define    IDirectPlay8Server_ReturnBuffer(p,a,b)                    (p)->ReturnBuffer(a,b)
  1044. #define    IDirectPlay8Server_GetPlayerContext(p,a,b,c)            (p)->GetPlayerContext(a,b,c)
  1045. #define    IDirectPlay8Server_GetGroupContext(p,a,b,c)                (p)->GetGroupContext(a,b,c)
  1046. #define    IDirectPlay8Server_GetCaps(p,a,b)                        (p)->GetCaps(a,b)
  1047. #define    IDirectPlay8Server_SetCaps(p,a,b)                        (p)->SetCaps(a,b)
  1048. #define    IDirectPlay8Server_SetSPCaps(p,a,b,c)                    (p)->SetSPCaps(a,b,c)
  1049. #define    IDirectPlay8Server_GetSPCaps(p,a,b,c)                    (p)->GetSPCaps(a,b,c)
  1050. #define    IDirectPlay8Server_GetConnectionInfo(p,a,b,c)            (p)->GetConnectionInfo(a,b,c)
  1051. #define    IDirectPlay8Server_RegisterLobby(p,a,b,c)                (p)->RegisterLobby(a,b,c)
  1052.  
  1053. #define    IDirectPlay8Peer_QueryInterface(p,a,b)                    (p)->QueryInterface(a,b)
  1054. #define    IDirectPlay8Peer_AddRef(p)                                (p)->AddRef()
  1055. #define    IDirectPlay8Peer_Release(p)                                (p)->Release()
  1056. #define    IDirectPlay8Peer_Initialize(p,a,b,c)                    (p)->Initialize(a,b,c)
  1057. #define    IDirectPlay8Peer_EnumServiceProviders(p,a,b,c,d,e,f)    (p)->EnumServiceProviders(a,b,c,d,e,f)
  1058. #define    IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)        (p)->EnumHosts(a,b,c,d,e,f,g,h,i,j,k)
  1059. #define    IDirectPlay8Peer_CancelAsyncOperation(p,a,b)            (p)->CancelAsyncOperation(a,b)
  1060. #define    IDirectPlay8Peer_Connect(p,a,b,c,d,e,f,g,h,i,j,k)        (p)->Connect(a,b,c,d,e,f,g,h,i,j,k)
  1061. #define    IDirectPlay8Peer_SendTo(p,a,b,c,d,e,f,g)                (p)->SendTo(a,b,c,d,e,f,g)
  1062. #define    IDirectPlay8Peer_GetSendQueueInfo(p,a,b,c,d)            (p)->GetSendQueueInfo(a,b,c,d)
  1063. #define    IDirectPlay8Peer_Host(p,a,b,c,d,e,f,g)                    (p)->Host(a,b,c,d,e,f,g)
  1064. #define    IDirectPlay8Peer_GetApplicationDesc(p,a,b,c)            (p)->GetApplicationDesc(a,b,c)
  1065. #define    IDirectPlay8Peer_SetApplicationDesc(p,a,b)                (p)->SetApplicationDesc(a,b)
  1066. #define    IDirectPlay8Peer_CreateGroup(p,a,b,c,d,e)                (p)->CreateGroup(a,b,c,d,e)
  1067. #define    IDirectPlay8Peer_DestroyGroup(p,a,b,c,d)                (p)->DestroyGroup(a,b,c,d)
  1068. #define    IDirectPlay8Peer_AddPlayerToGroup(p,a,b,c,d,e)            (p)->AddPlayerToGroup(a,b,c,d,e)
  1069. #define    IDirectPlay8Peer_RemovePlayerFromGroup(p,a,b,c,d,e)        (p)->RemovePlayerFromGroup(a,b,c,d,e)
  1070. #define    IDirectPlay8Peer_SetGroupInfo(p,a,b,c,d,e)                (p)->SetGroupInfo(a,b,c,d,e)
  1071. #define    IDirectPlay8Peer_GetGroupInfo(p,a,b,c,d)                (p)->GetGroupInfo(a,b,c,d)
  1072. #define    IDirectPlay8Peer_EnumPlayersAndGroups(p,a,b,c)            (p)->EnumPlayersAndGroups(a,b,c)
  1073. #define    IDirectPlay8Peer_EnumGroupMembers(p,a,b,c,d)            (p)->EnumGroupMembers(a,b,c,d)
  1074. #define    IDirectPlay8Peer_SetPeerInfo(p,a,b,c,d)                    (p)->SetPeerInfo(a,b,c,d)
  1075. #define    IDirectPlay8Peer_GetPeerInfo(p,a,b,c,d)                    (p)->GetPeerInfo(a,b,c,d)
  1076. #define    IDirectPlay8Peer_GetPeerAddress(p,a,b,c)                (p)->GetPeerAddress(a,b,c)
  1077. #define    IDirectPlay8Peer_GetLocalHostAddresses(p,a,b,c)            (p)->GetLocalHostAddresses(a,b,c)
  1078. #define    IDirectPlay8Peer_Close(p,a)                                (p)->Close(a)
  1079. #define    IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k)        (p)->EnumHosts(a,b,c,d,e,f,g,h,i,j,k)
  1080. #define    IDirectPlay8Peer_DestroyPeer(p,a,b,c,d)                    (p)->DestroyPeer(a,b,c,d)
  1081. #define    IDirectPlay8Peer_ReturnBuffer(p,a,b)                    (p)->ReturnBuffer(a,b)
  1082. #define    IDirectPlay8Peer_GetPlayerContext(p,a,b,c)                (p)->GetPlayerContext(a,b,c)
  1083. #define    IDirectPlay8Peer_GetGroupContext(p,a,b,c)                (p)->GetGroupContext(a,b,c)
  1084. #define    IDirectPlay8Peer_GetCaps(p,a,b)                            (p)->GetCaps(a,b)
  1085. #define    IDirectPlay8Peer_SetCaps(p,a,b)                            (p)->SetCaps(a,b)
  1086. #define    IDirectPlay8Peer_SetSPCaps(p,a,b,c)                        (p)->SetSPCaps(a,b,c)
  1087. #define    IDirectPlay8Peer_GetSPCaps(p,a,b,c)                        (p)->GetSPCaps(a,b,c)
  1088. #define    IDirectPlay8Peer_GetConnectionInfo(p,a,b,c)                (p)->GetConnectionInfo(a,b,c)
  1089. #define    IDirectPlay8Peer_RegisterLobby(p,a,b,c)                    (p)->RegisterLobby(a,b,c)
  1090. #define    IDirectPlay8Peer_TerminateSession(p,a,b,c)                (p)->TerminateSession(a,b,c)
  1091.  
  1092. #endif
  1093.  
  1094. /****************************************************************************
  1095.  *
  1096.  * DIRECTPLAY8 ERRORS
  1097.  *
  1098.  * Errors are represented by negative values and cannot be combined.
  1099.  *
  1100.  ****************************************************************************/
  1101.  
  1102. #define _DPN_FACILITY_CODE    0x015
  1103. #define _DPNHRESULT_BASE        0x8000
  1104. #define MAKE_DPNHRESULT( code )            MAKE_HRESULT( 1, _DPN_FACILITY_CODE, ( code + _DPNHRESULT_BASE ) )
  1105.  
  1106. #define DPN_OK                            S_OK
  1107.  
  1108. #define DPNSUCCESS_EQUAL                MAKE_HRESULT( 0, _DPN_FACILITY_CODE, ( 0x5 + _DPNHRESULT_BASE ) )
  1109. #define DPNSUCCESS_NOTEQUAL             MAKE_HRESULT( 0, _DPN_FACILITY_CODE, (0x0A + _DPNHRESULT_BASE ) )
  1110. #define DPNSUCCESS_PENDING                MAKE_HRESULT( 0, _DPN_FACILITY_CODE, (0x0e + _DPNHRESULT_BASE ) )
  1111.  
  1112. #define DPNERR_ABORTED                    MAKE_DPNHRESULT(  0x30 )
  1113. #define DPNERR_ADDRESSING                MAKE_DPNHRESULT(  0x40 )
  1114. #define    DPNERR_ALREADYCLOSING            MAKE_DPNHRESULT(  0x50 )
  1115. #define DPNERR_ALREADYCONNECTED            MAKE_DPNHRESULT(  0x60 )
  1116. #define DPNERR_ALREADYDISCONNECTING        MAKE_DPNHRESULT(  0x70 )
  1117. #define DPNERR_ALREADYINITIALIZED        MAKE_DPNHRESULT(  0x80 )
  1118. #define DPNERR_ALREADYREGISTERED        MAKE_DPNHRESULT(  0x90 )
  1119. #define DPNERR_BUFFERTOOSMALL            MAKE_DPNHRESULT( 0x100 )
  1120. #define DPNERR_CANNOTCANCEL                MAKE_DPNHRESULT( 0x110 )
  1121. #define DPNERR_CANTCREATEGROUP            MAKE_DPNHRESULT( 0x120 )
  1122. #define DPNERR_CANTCREATEPLAYER            MAKE_DPNHRESULT( 0x130 )
  1123. #define DPNERR_CANTLAUNCHAPPLICATION    MAKE_DPNHRESULT( 0x140 )
  1124. #define DPNERR_CONNECTING                MAKE_DPNHRESULT( 0x150 )
  1125. #define DPNERR_CONNECTIONLOST            MAKE_DPNHRESULT( 0x160 )
  1126. #define DPNERR_CONVERSION                MAKE_DPNHRESULT( 0x170 )
  1127. #define    DPNERR_DATATOOLARGE                MAKE_DPNHRESULT( 0x175 )
  1128. #define DPNERR_DOESNOTEXIST                MAKE_DPNHRESULT( 0x180 )
  1129. #define DPNERR_DUPLICATECOMMAND            MAKE_DPNHRESULT( 0x190 )
  1130. #define DPNERR_ENDPOINTNOTRECEIVING        MAKE_DPNHRESULT( 0x200 )
  1131. #define    DPNERR_ENUMQUERYTOOLARGE        MAKE_DPNHRESULT( 0x210 )
  1132. #define    DPNERR_ENUMRESPONSETOOLARGE        MAKE_DPNHRESULT( 0x220 )
  1133. #define DPNERR_EXCEPTION                MAKE_DPNHRESULT( 0x230 )
  1134. #define DPNERR_GENERIC                    E_FAIL
  1135. #define DPNERR_GROUPNOTEMPTY            MAKE_DPNHRESULT( 0x240 )
  1136. #define DPNERR_HOSTING                  MAKE_DPNHRESULT( 0x250 )
  1137. #define DPNERR_HOSTREJECTEDCONNECTION    MAKE_DPNHRESULT( 0x260 )
  1138. #define DPNERR_HOSTTERMINATEDSESSION    MAKE_DPNHRESULT( 0x270 )
  1139. #define DPNERR_INCOMPLETEADDRESS        MAKE_DPNHRESULT( 0x280 )
  1140. #define DPNERR_INVALIDADDRESSFORMAT        MAKE_DPNHRESULT( 0x290 )
  1141. #define DPNERR_INVALIDAPPLICATION        MAKE_DPNHRESULT( 0x300 )
  1142. #define DPNERR_INVALIDCOMMAND            MAKE_DPNHRESULT( 0x310 )
  1143. #define DPNERR_INVALIDDEVICEADDRESS        MAKE_DPNHRESULT( 0x320 )
  1144. #define DPNERR_INVALIDENDPOINT            MAKE_DPNHRESULT( 0x330 )
  1145. #define DPNERR_INVALIDFLAGS                MAKE_DPNHRESULT( 0x340 )
  1146. #define DPNERR_INVALIDGROUP                 MAKE_DPNHRESULT( 0x350 )
  1147. #define DPNERR_INVALIDHANDLE            MAKE_DPNHRESULT( 0x360 )
  1148. #define DPNERR_INVALIDHOSTADDRESS        MAKE_DPNHRESULT( 0x370 )
  1149. #define DPNERR_INVALIDINSTANCE            MAKE_DPNHRESULT( 0x380 )
  1150. #define DPNERR_INVALIDINTERFACE            MAKE_DPNHRESULT( 0x390 )
  1151. #define DPNERR_INVALIDOBJECT            MAKE_DPNHRESULT( 0x400 )
  1152. #define DPNERR_INVALIDPARAM                E_INVALIDARG
  1153. #define DPNERR_INVALIDPASSWORD            MAKE_DPNHRESULT( 0x410 )
  1154. #define DPNERR_INVALIDPLAYER            MAKE_DPNHRESULT( 0x420 )
  1155. #define DPNERR_INVALIDPOINTER            E_POINTER
  1156. #define DPNERR_INVALIDPRIORITY            MAKE_DPNHRESULT( 0x430 )
  1157. #define DPNERR_INVALIDSTRING            MAKE_DPNHRESULT( 0x440 )
  1158. #define DPNERR_INVALIDURL                MAKE_DPNHRESULT( 0x450 )
  1159. #define    DPNERR_INVALIDVERSION            MAKE_DPNHRESULT( 0x460 )
  1160. #define DPNERR_NOCAPS                    MAKE_DPNHRESULT( 0x470 )
  1161. #define DPNERR_NOCONNECTION                MAKE_DPNHRESULT( 0x480 )
  1162. #define DPNERR_NOHOSTPLAYER                MAKE_DPNHRESULT( 0x490 )
  1163. #define DPNERR_NOINTERFACE                E_NOINTERFACE
  1164. #define DPNERR_NOMOREADDRESSCOMPONENTS    MAKE_DPNHRESULT( 0x500 )
  1165. #define DPNERR_NORESPONSE                MAKE_DPNHRESULT( 0x510 )
  1166. #define DPNERR_NOTALLOWED                MAKE_DPNHRESULT( 0x520 )
  1167. #define DPNERR_NOTHOST                    MAKE_DPNHRESULT( 0x530 )
  1168. #define DPNERR_NOTREADY                    MAKE_DPNHRESULT( 0x540 )
  1169. #define DPNERR_NOTREGISTERED            MAKE_DPNHRESULT( 0x550 )
  1170. #define DPNERR_OUTOFMEMORY                E_OUTOFMEMORY
  1171. #define DPNERR_PENDING                    DPNSUCCESS_PENDING
  1172. #define DPNERR_PLAYERALREADYINGROUP     MAKE_DPNHRESULT( 0x560 )
  1173. #define DPNERR_PLAYERLOST                MAKE_DPNHRESULT( 0x570 )
  1174. #define DPNERR_PLAYERNOTINGROUP         MAKE_DPNHRESULT( 0x580 )
  1175. #define    DPNERR_PLAYERNOTREACHABLE        MAKE_DPNHRESULT( 0x590 )
  1176. #define DPNERR_SENDTOOLARGE                MAKE_DPNHRESULT( 0x600 )
  1177. #define DPNERR_SESSIONFULL                MAKE_DPNHRESULT( 0x610 )
  1178. #define DPNERR_TABLEFULL                MAKE_DPNHRESULT( 0x620 )
  1179. #define DPNERR_TIMEDOUT                    MAKE_DPNHRESULT( 0x630 )
  1180. #define DPNERR_UNINITIALIZED            MAKE_DPNHRESULT( 0x640 )
  1181. #define DPNERR_UNSUPPORTED                E_NOTIMPL
  1182. #define DPNERR_USERCANCEL                MAKE_DPNHRESULT( 0x650 )
  1183.  
  1184. #ifdef __cplusplus
  1185. }
  1186. #endif
  1187.  
  1188. #endif
  1189.  
  1190.